Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

.github/workflows/main-check.yml revert-6662-cmp-1120-rc01 (0eb95531) Text, 6.36 KB

Tff7b72nameTb4b4b4: Ta5d6ffMainTa5d6ff Ta5d6ffCITa5d6ff Ta5d6ff(VerifyTa5d6ff Ta5d6ff&Ta5d6ff Ta5d6ffBuild)

Tff7b72onTb4b4b4:
Tff7b72pushTb4b4b4:
Tff7b72branchesTb4b4b4: Tb4b4b4[ Te6edf3main Tb4b4b4]
Tff7b72paths-ignoreTb4b4b4:
Tb4b4b4- Ta5d6ff'Ta5d6ff**/*.mdTa5d6ff'
Tb4b4b4- Ta5d6ff'Ta5d6ffdocs/**Ta5d6ff'

Tff7b72permissionsTb4b4b4:
Tff7b72contentsTb4b4b4: Ta5d6ffread

Tff7b72concurrencyTb4b4b4:
Tff7b72groupTb4b4b4: Ta5d6ffmain-${{Ta5d6ff Ta5d6ffgithub.refTa5d6ff Ta5d6ff}}
Tff7b72cancel-in-progressTb4b4b4: Ta5d6fftrue

Tff7b72jobsTb4b4b4:
T8b949e# Every commit on main arrives via the merge queue, which already ran lint,
T8b949e# screenshot validation, rb-check, and the (coverage-free) test shards on this
T8b949e# exact merge commit. This workflow:
T8b949e# - re-runs the test shards WITH coverage: Kover instrumentation lives here,
T8b949e# off the queue's critical path, and this is the sole source of Codecov
T8b949e# mainline coverage (PRs and the queue both skip it)
T8b949e# - builds the debug APKs for the snapshot release below with -SNAPSHOT
T8b949e# naming (the queue skips run_android_build; the PR already assembled them)
T8b949e# - builds the desktop distributables. Desktop packaging runs here post-merge
T8b949e# rather than in the merge queue: :desktopApp:test in the queue's shard-app
T8b949e# already covers compilation, and the 4-OS matrix (macos/windows queue
T8b949e# times) would slow every merge.
T8b949e# run_lint: false skips lint, screenshot-check, and rb-check (queue-verified).
Tff7b72validate-and-buildTb4b4b4:
Tff7b72ifTb4b4b4: Ta5d6ffgithub.repositoryTa5d6ff Ta5d6ff==Ta5d6ff Ta5d6ff'meshtastic/Meshtastic-Android'
Tff7b72usesTb4b4b4: Ta5d6ff./.github/workflows/reusable-check.yml
Tff7b72permissionsTb4b4b4:
Tff7b72contentsTb4b4b4: Ta5d6ffwrite T8b949e# dependency-graph submission (android-check)
Tff7b72pull-requestsTb4b4b4: Ta5d6ffwrite
Tff7b72withTb4b4b4:
Tff7b72run_lintTb4b4b4: Ta5d6fffalse
Tff7b72run_unit_testsTb4b4b4: Ta5d6fftrue
Tff7b72run_coverageTb4b4b4: Ta5d6fftrue
Tff7b72run_desktop_buildsTb4b4b4: Ta5d6fftrue
Tff7b72upload_artifactsTb4b4b4: Ta5d6fftrue
Tff7b72secretsTb4b4b4: Ta5d6ffinherit

T8b949e# Republishes the debug APKs validate-and-build already produced as a rolling "snapshot"
T8b949e# prerelease that moves to HEAD on every push to main, so testers get a stable download
T8b949e# link instead of digging through Actions artifacts (which require a GitHub login and
T8b949e# expire after 7 days).
Tff7b72publish-snapshotTb4b4b4:
Tff7b72needsTb4b4b4: Ta5d6ffvalidate-and-build
T8b949e# !cancelled(): a desktop-matrix failure fails validate-and-build as a whole, but the
T8b949e# Android APKs may still have built fine — attempt the snapshot regardless. If the
T8b949e# APK build itself failed, the artifact download below fails and this job goes red.
Tff7b72ifTb4b4b4: Ta5d6ffgithub.repositoryTa5d6ff Ta5d6ff==Ta5d6ff Ta5d6ff'meshtastic/Meshtastic-Android'Ta5d6ff Ta5d6ff&&Ta5d6ff Ta5d6ff!cancelled()
Tff7b72runs-onTb4b4b4: Ta5d6ffubuntu-24.04-arm
Tff7b72timeout-minutesTb4b4b4: Ta5d6ff10
Tff7b72permissionsTb4b4b4:
Tff7b72contentsTb4b4b4: Ta5d6ffwrite
Tff7b72envTb4b4b4:
T8b949e# CROWDIN_GITHUB_TOKEN (a PAT), not the default GITHUB_TOKEN, because the repo's tag
T8b949e# rulesets block the default token from creating/deleting tags — same token every other
T8b949e# tag-touching workflow here uses.
Tff7b72GH_TOKENTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffsecrets.CROWDIN_GITHUB_TOKENTa5d6ff Ta5d6ff}}
Tff7b72stepsTb4b4b4:
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffCheckoutTa5d6ff Ta5d6ffcode
Tff7b72usesTb4b4b4: Ta5d6ffactions/checkout@v7.0.1
Tff7b72withTb4b4b4:
Tff7b72fetch-depthTb4b4b4: Ta5d6ff0 T8b949e# git rev-list --count needs full history for the versionCode
Tff7b72tokenTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffsecrets.CROWDIN_GITHUB_TOKENTa5d6ff Ta5d6ff}}
Tff7b72persist-credentialsTb4b4b4: Ta5d6fffalse T8b949e# no git push here; gh does the authed work via GH_TOKEN

Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffDownloadTa5d6ff Ta5d6ffdebugTa5d6ff Ta5d6ffAPKs
Tff7b72usesTb4b4b4: Ta5d6ffactions/download-artifact@v8
Tff7b72withTb4b4b4:
Tff7b72nameTb4b4b4: Ta5d6ffapp-debug-apks
Tff7b72pathTb4b4b4: Ta5d6ffartifacts

T8b949e# Desktop installers land in per-OS artifacts (desktop-app-<os>-<arch>). A matrix leg
T8b949e# failing (e.g. one OS's packaging breaks) shouldn't block publishing the rest, so this
T8b949e# doesn't fail the job if some/all are missing — see the !cancelled() gate above.
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffDownloadTa5d6ff Ta5d6ffdesktopTa5d6ff Ta5d6ffinstallers
Tff7b72usesTb4b4b4: Ta5d6ffactions/download-artifact@v8
Tff7b72continue-on-errorTb4b4b4: Ta5d6fftrue
Tff7b72withTb4b4b4:
Tff7b72patternTb4b4b4: Ta5d6ffdesktop-app-*
Tff7b72pathTb4b4b4: Ta5d6ffdesktop-artifacts

T8b949e# A moving tag reuses the same release URL forever, and Obtainium fingerprints the
T8b949e# asset URL — so without a changing filename it would never detect a new build.
T8b949e# Embed the (monotonic) versionCode in each APK name; same formula the app build uses.
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffRenameTa5d6ff Ta5d6ffAPKsTa5d6ff Ta5d6ffwithTa5d6ff Ta5d6ffversionCode
Tff7b72runTb4b4b4: Tb4b4b4|
Tff7b72COMMIT_COUNT=$(git rev-list --count HEAD)
Tff7b72OFFSET=$(grep '^VERSION_CODE_OFFSET=' config.properties | cut -d'=' -f2)
Tff7b72VERSION_CODE=$((COMMIT_COUNT + OFFSET))
Tff7b72echo "VERSION_CODE=$VERSION_CODE" >> "$GITHUB_ENV"
Tff7b72mkdir -p upload
Tff7b72find artifacts -name '*.apk' | while read -r f; do
Tff7b72cp "$f" "upload/$(basename "$f" .apk)-${VERSION_CODE}.apk"
Tff7b72done
Tff7b72ls -l upload

T8b949e# Desktop installer filenames already embed the OS/arch (jpackage) plus a "snapshot"
T8b949e# version tag baked into the AppImage step, but stamp the versionCode on too so every
T8b949e# asset in the release moves in lockstep and testers can tell builds apart at a glance.
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffStageTa5d6ff Ta5d6ffdesktopTa5d6ff Ta5d6ffinstallers
Tff7b72runTb4b4b4: Tb4b4b4|
Tff7b72mkdir -p desktop-artifacts
Tff7b72find desktop-artifacts -type f \( -name '*.dmg' -o -name '*.msi' -o -name '*.exe' \
Tff7b72-o -name '*.deb' -o -name '*.rpm' -o -name '*.AppImage' \) | while read -r f; do
Tff7b72base="$(basename "$f")"
Tff7b72ext="${base##*.}"
Tff7b72name="${base%.*}"
Tff7b72cp "$f" "upload/${name}-${VERSION_CODE}.${ext}"
Tff7b72done
Tff7b72ls -l upload

T8b949e# Delete the previous snapshot release AND its tag, then recreate both at HEAD. This
T8b949e# prunes the now-stale (differently-named) APKs so they don't pile up, and sidesteps the
T8b949e# Releases API refusing to retarget an already-existing tag.
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffRemoveTa5d6ff Ta5d6ffpreviousTa5d6ff Ta5d6ffsnapshotTa5d6ff Ta5d6ffrelease
Tff7b72runTb4b4b4: Ta5d6ffghTa5d6ff Ta5d6ffreleaseTa5d6ff Ta5d6ffdeleteTa5d6ff Ta5d6ffsnapshotTa5d6ff Ta5d6ff--yesTa5d6ff Ta5d6ff--cleanup-tagTa5d6ff Ta5d6ff||Ta5d6ff Ta5d6fftrue

Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffPublishTa5d6ff Ta5d6ffsnapshotTa5d6ff Ta5d6ffrelease
Tff7b72runTb4b4b4: Tb4b4b4|
Tff7b72cat > notes.md <<EOF
Tff7b72Automated debug build from the latest commit on \`main\` ($GITHUB_SHA), versionCode $VERSION_CODE.
Tff7b72Unsigned/debug-keyed, F-Droid and Google flavors. Not for production use — this release is replaced on every push to main.

Tff7b72Also includes unsigned desktop installers (macOS .dmg, Windows .msi/.exe, Linux .deb/.rpm/.AppImage)
Tff7b72built from the same commit, when that platform's build succeeded.

Tff7b72**Obtainium:** enable *Include prereleases*. Each build's APK filename carries the versionCode, so updates are detected.
Tff7b72EOF
Tff7b72gh release create snapshot upload/* \
Tff7b72--title "Snapshot $VERSION_CODE ($GITHUB_SHA)" \
Tff7b72--target "$GITHUB_SHA" \
Tff7b72--prerelease \
Tff7b72--notes-file notes.md

Served by rngit 1.5.2 - Generated in 0.07s